<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Discount')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-discount" data-rule="required" class="form-control" name="row[discount]" type="number" value="{$row.discount|htmlentities}">
            <small style="display: inline-block; margin-top: 5px; ">注：95表示95%，表示9.5折</small>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Direct_upgrade')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-direct_upgrade" data-rule="required" class="form-control" name="row[direct_upgrade]" type="number" value="{$row.direct_upgrade|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Amass_upgrade')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-amass_upgrade" data-rule="required" class="form-control" name="row[amass_upgrade]" type="number" value="{$row.amass_upgrade|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Equity_id')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="checkbox">
                <?php foreach($equities as $key=>$vo): ?>
                <label for="row[equity_id][]-{$key}">
                    <input id="row[equity_id][]-{$key}" name="row[equity_id][]" type="checkbox" value="{$vo->id}"
                    <?php if(in_array($vo->id, $equityIds)) {echo "checked"; } ?>
                    /> {$vo->title}
                </label>
                <?php endForeach; ?>
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('优惠券')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="checkbox">

                <?php foreach($coupons as $key=>$vo): ?>

                    <label for="row[coupon][]-{$key}" style="display: block;">
                        <input id="row[coupon][]-{$key}" name="row[coupon][]" type="checkbox" value="{$vo->id}"
                        <?php if($vip_coupons) {
                            foreach($vip_coupons as $val) {
                                if ($vo->id == $val->coupon_id) {
                                    echo "checked";
                                }
                            }
                        }?>
                        /> {$vo->title}
                        <input id="row-num" style="margin-left: 15px;" name="row[num][{$vo->id}]" type="number" min="0" value="<?php if($vip_coupons) {
                            foreach($vip_coupons as $val) {
                                if ($vo->id == $val->coupon_id) {
                                    echo $val->num;
                                }
                            }
                        }?>" placeholder="请输入数量">
                    </label>

                <?php endForeach; ?>
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Online')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                {foreach name="onlineList" item="vo"}
                <label for="row[online]-{$key}"><input id="row[online]-{$key}" name="row[online]" type="radio" value="{$key}" {in name="key" value="$row.online"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-description" class="form-control " rows="5" name="row[description]" cols="50">{$row.description}</textarea>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
